﻿using Core.AutoFacService.Enums;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Core.AutoFacService.Attributes.InjectAttributes
{
    /// <summary>
    /// 接口依赖注入特性
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = false)]
    public class InjectAttribute: Attribute
    {
        public LifetimeEnum Lifetime { get; }
        public string Name { get;}
        public int Order { get; set; }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="lifetime">实例声明周期</param>
        /// <param name="name">实例别名</param>
        /// <param name="order">注册排序(小数在前)</param>
        public InjectAttribute(LifetimeEnum lifetime= LifetimeEnum.Scope,string name="",int order=0)
        {
            Lifetime = lifetime;
            Name = name;
            Order = order;
        }
    }
}
